<?php
/**
 * This file is part of the Yacms (http://www.yacms.org)
 * Copyright (c) 2019 gylr0505 (http://www.yacms.org)
 *
 * Author: 鬼一浪人 <gylr0505@163.com>
 *
 * DateTime: 19-10-29 下午10:01
 * Description:
 */

include_once __DIR__.'/vendor/autoload.php';


\Swoft\Timer::tick(1, function ($paramOne, $paramTwo) {
    \App\Model\Entity\TemplateSendLog::query()->select('id')->chunk(100,function ($results, $page){
        foreach ($results as $item){
            $log = new \App\Template\Log\Sync($item['id'] ?? 0);
            $log->execute();
            $log = null;
        }
    });

});